/**
 * 
 */
package com.lunevich.json;

import com.lunevich.json.activity.JsonArrayActivity;
import com.lunevich.json.activity.JsonObjectActivity;
import com.lunevich.json.activity.XMLActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;

/**
 * @author Andrei_Lunevich
 *
 */
public class AndroidActivity extends Activity implements OnClickListener {
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
        
        Button jsonObject = (Button) findViewById(R.id.btnJsonObject);
        Button jsonArray = (Button) findViewById(R.id.btnJsonArray);
        Button xmlData = (Button) findViewById(R.id.btnXMLData);
        
        jsonObject.setOnClickListener(this);
        jsonArray.setOnClickListener(this);
        xmlData.setOnClickListener(this);
    }

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btnJsonObject:
			Intent intentObject = new Intent(AndroidActivity.this, JsonObjectActivity.class);
			startActivity(intentObject);
			break;
		case R.id.btnJsonArray:
			Intent intentArray = new Intent(AndroidActivity.this, JsonArrayActivity.class);
			startActivity(intentArray);
			break;
		case R.id.btnXMLData:
			Intent intentXML = new Intent(AndroidActivity.this, XMLActivity.class);
			startActivity(intentXML);
			break;
		}
	}
}